package com.xianyu.us.common.utils;

import org.apache.shiro.SecurityUtils;

import com.xianyu.us.pojo.entity.UsUser;
/**
 * 定义一个工具类(ShiroUtils)，获取用户登陆信息id,及username
 * @author J
 *
 */
public class ShiroUtils {
	public static String getUsername() {
		return getUser().getUsername();
	}
	public static Integer getId() {
		return getUser().getId();
	}
	
	public static UsUser getUser() {
		return (UsUser)SecurityUtils.getSubject().getPrincipal();	
	}
	
}
